/**
 * @desc 账号管理
 * @param
 * @author zhoujie
 * @date 2022/11/24 10:31:22
 */

import request from '@/assets/common/js/utils/request';
// 获取账户列表信息
export function accountinfoGetlist(data) {
    return request({
        url: 'accountinfo/getlist',
        method: 'post',
        data: data,
    });
}
// 添加账户信息
export function accountinfoCreate(data) {
    return request({
        url: 'accountinfo/create',
        method: 'post',
        data: data,
    });
}
// 更新账户信息
export function accountinfoUpdate(data) {
    return request({
        url: `accountinfo/update/${data.id}`,
        method: 'put',
        data: data,
    });
}
// 删除账户信息
export function accountinfoDelete(data) {
    return request({
        url: `accountinfo/delete?id=${data.id}`,
        method: 'delete',
        data: data,
    });
}
/**
 * @desc 单个设备取消绑定
 * @param
 * @author zhoujie
 * @date 2022/12/30 09:43:37
 */

export function singleunbindingDevice(data) {
    return request({
        url: `userdevice/bindingdevice/${data.userId}/binding`,
        method: "PUT",
        data: data,
    })
}

//重置密码
export function resetPassword(data) {
    return request({
        url:`users/resetpassword/reset-password`,
        method: 'post',
        data: data,
    });
}
/**
 * @desc 修改密码
 * @param
 * @author qiankui
 * @date 2023-5-24 09:42:53
 */
export function accountinfoChangepassword(data) {
    var  form = new FormData();
    form.append("userName",data.userName)
    form.append("oldPassword",data.oldPassword)
    form.append("newPassword",data.newPassword)
    return request({
        url:`accountinfo/changepassword`,
        method: 'post',
        data: form,
    });
}
